<template>
	<div>
		<div class='data-item' v-for="(item,idx) in dataList" :key='idx' @click="detail(item)">
			<div class='data-name'> <image src='../../../static/images/jm1.png'></image> {{item.name}}<text>|</text></div>
			<div class='data-num'>共<text>{{item.makerSum}}</text>台{{jq}}</div>
		</div>
	</div>
	
</template>
<script type="text/javascript">
	import {get} from '../../utils/index'

	export default{
		data(){
			return {
				style:0,
				dataList:[],
				jq:'机器'
			}
		},
		async mounted(){
			this.style = this.$root.$mp.query.stype;
			var datas = {
				limit: 9999,
		        offset: 0,
		        parent: wx.getStorageSync('userDo').id,
		        type: this.style,
		        makerSum:1,
		        tfont: wx.getStorageSync('userDo').font
			}
			this.dataList = await get('getAgentListByAgentId',datas)
		},
		methods:{
			detail(item){
				var userid = item.userId
			    var usertype = item.type
			    wx.navigateTo({
			      url: '/pages/coffeeMakerList/main?userid=' + userid + '&usertype=' + usertype,
			    })
				
			}
		}
		
	}
</script>
<style>
.data-item{
  display: flex;
  padding:0 20rpx;
  background: #e7e7e7;
  font-size: 26rpx;
  margin: 20px;
  height: 76rpx;
  line-height: 76rpx;
}
.data-name,.data-num{
  flex: 1;
  
}
.data-num{
  text-align: center;
}
.data-name{
  position: relative;
  padding-left: 86rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-name image{
  position: absolute;
  left: 20rpx;
  width: 50rpx;
  height: 50rpx;
  top: 50%;
  transform: translateY(-50%)
}
.data-name text{
  position: absolute;
  right: 0;
}
.data-num text{
  color: red;
  padding: 0 10rpx;
}

</style>